Release 10.1A: OpenEdge Development:
Progress 4GL Reference


EXTENT function

This function returns the extent of an array field or variable. More specifically, it returns:

Syntax

EXTENT ( array ) 

array

Any array field or variable.

Example

In the following example, the EXTENT function is used to set the limit of a DO loop that cycles through all elements of an array:

r-arrext.p
DEFINE VARIABLE int_value AS INTEGER EXTENT 3 INITIAL [1, 2, 3].

DEFINE VARIABLE i     AS INTEGER.
DEFINE VARIABLE tot   AS INTEGER LABEL "The total is".

DO i = 1 TO EXTENT(int_value):
   tot = tot + int_value[i].
END.

DISPLAY tot. 

See also

DEFINE VARIABLE statement, ENTRY function, EXTENT attribute


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095